/////////////////////////////////////////////////////////////////////////////
// Name:        MirrorlistPanel.h
// Purpose:     
// Author:      yospaly
// Modified by: 
// Created:     05/01/2010 11:09:27
// RCS-ID:      
// Copyright:   Copyright (C) 2008, yospaly
// Licence:     
/////////////////////////////////////////////////////////////////////////////

#ifndef _MIRRORLISTPANEL_H_
#define _MIRRORLISTPANEL_H_


/*!
 * Includes
 */

////@begin includes
#include "wx/treectrl.h"
////@end includes

/*!
 * Forward declarations
 */

////@begin forward declarations
class wxTreeCtrl;
////@end forward declarations

/*!
 * Control identifiers
 */

////@begin control identifiers
#define ID_MIRRORLISTPANEL 10056
#define ID_REFRESH_MIRRORSLIST_BUTTON 10037
#define ID_MIRRORS_TREE 10029
#define ID_MIRROR_TEXT 10030
#define SYMBOL_MIRRORLISTPANEL_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL
#define SYMBOL_MIRRORLISTPANEL_TITLE _("MirrorlistPanel")
#define SYMBOL_MIRRORLISTPANEL_IDNAME ID_MIRRORLISTPANEL
#define SYMBOL_MIRRORLISTPANEL_SIZE wxSize(400, 400)
#define SYMBOL_MIRRORLISTPANEL_POSITION wxDefaultPosition
////@end control identifiers


/*!
 * MirrorlistPanel class declaration
 */

class MirrorlistPanel: public wxPanel
{    
    DECLARE_DYNAMIC_CLASS( MirrorlistPanel )
    DECLARE_EVENT_TABLE()

public:
    /// Constructors
    MirrorlistPanel();
    MirrorlistPanel( wxWindow* parent, wxWindowID id = SYMBOL_MIRRORLISTPANEL_IDNAME, const wxString& caption = SYMBOL_MIRRORLISTPANEL_TITLE, const wxPoint& pos = SYMBOL_MIRRORLISTPANEL_POSITION, const wxSize& size = SYMBOL_MIRRORLISTPANEL_SIZE, long style = SYMBOL_MIRRORLISTPANEL_STYLE );

    /// Creation
    bool Create( wxWindow* parent, wxWindowID id = SYMBOL_MIRRORLISTPANEL_IDNAME, const wxString& caption = SYMBOL_MIRRORLISTPANEL_TITLE, const wxPoint& pos = SYMBOL_MIRRORLISTPANEL_POSITION, const wxSize& size = SYMBOL_MIRRORLISTPANEL_SIZE, long style = SYMBOL_MIRRORLISTPANEL_STYLE );

    /// Destructor
    ~MirrorlistPanel();

    /// Initialises member variables
    void Init();

    /// Creates the controls and sizers
    void CreateControls();

////@begin MirrorlistPanel event handler declarations

    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_REFRESH_MIRRORSLIST_BUTTON
    void OnREFRESHMIRRORSLISTBUTTONClick( wxCommandEvent& event );

    /// wxEVT_COMMAND_TREE_SEL_CHANGED event handler for ID_MIRRORS_TREE
    void OnMIRRORSTREESelChanged( wxTreeEvent& event );

////@end MirrorlistPanel event handler declarations

////@begin MirrorlistPanel member function declarations

    /// Retrieves bitmap resources
    wxBitmap GetBitmapResource( const wxString& name );

    /// Retrieves icon resources
    wxIcon GetIconResource( const wxString& name );
////@end MirrorlistPanel member function declarations

    /// Should we show tooltips?
    static bool ShowToolTips();

////@begin MirrorlistPanel member variables
    wxButton* p_refresh_button;
    wxTreeCtrl* p_mirrors_tree;
    wxStaticText* p_location_static;
    wxTextCtrl* p_mirror_text;
////@end MirrorlistPanel member variables

    MirrorlistPanel(wxWindow* parent, wxWindowID id = SYMBOL_MIRRORLISTPANEL_IDNAME, \
            const wxPoint& pos = SYMBOL_MIRRORLISTPANEL_POSITION, const wxSize& size = SYMBOL_MIRRORLISTPANEL_SIZE, \
            long style = SYMBOL_MIRRORLISTPANEL_STYLE, const wxString& name = _T("mirrorlistpanel"))
    {
        Init();
        Create(parent, id, SYMBOL_MIRRORLISTPANEL_TITLE, pos, size, style);
    }
    
    void init_tree();
    void reload_tree();
    void check_reload_tree();
};

#endif
    // _MIRRORLISTPANEL_H_
